package com.vietnam.power.persitence;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


/**
 * The persistent class for the product_images database table.
 * 
 */
@Entity
@Table(name="article_images")
public class ArticleImage implements Serializable {
	private static final long serialVersionUID = 1L;
	private int id;
	private Article article;
	private FileUpload fileUpload;

	public ArticleImage() {
	}


	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}


	//bi-directional many-to-one association to Product
	@ManyToOne(fetch=FetchType.LAZY)
	public Article getArticle() {
		return this.article;
	}

	public void setArticle(Article article) {
		this.article = article;
	}


	//bi-directional many-to-one association to FileUpload
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="file_upload_id")
	public FileUpload getFileUpload() {
		return this.fileUpload;
	}

	public void setFileUpload(FileUpload fileUpload) {
		this.fileUpload = fileUpload;
	}

}